package test.android.lin.fragmenttest;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by linxiaobin on 2016/3/21.
 */
public class NewsContentFragment extends Fragment {
    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.news_content_frag, null);
        return view;

    }

    public void refresh(String newsTitle, String newsContent) {
        View visibilityView = (View) view.findViewById(R.id.visibility_layout);
        visibilityView.setVisibility(View.VISIBLE);
        TextView title = (TextView) view.findViewById(R.id.news_title);
        TextView content = (TextView) view.findViewById(R.id.news_content);

        title.setText(newsTitle);
        content.setText(newsContent);
    }
}













